﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml;

namespace FinPlusInterfaces
{
    public interface IBean : INotifyPropertyChanged
    {
        int Index { get; set; }
        int Id { get; set; }
        string Name { get; set; }
        object Object { get; set; }
        string Value { get; set; }
        Type Type { get; set; }
        string TypeName { get; set; }
        DateTime TimeStamp { get; set; }
        DateTime Closed { get; set; }
        string Display { get; set; }
        string User { get; set; }
       
        IBean Clone(int id);

        IBean Clone(int index, int id, string name, string value, Type type, DateTime timeStamp, string user = "Unknown");

        void Refresh();

        void Update(object obj, string user = null, bool notify = true);

        void Update(object obj, DateTime timeStamp, string user = null, bool notify = true);

        void Initialise(int index, int id, string name, object value, DateTime timeStamp, string user = "Unknown");

        bool Equals(IBean bean);

        void Evaluate(IPod pod, string expression);

        void Total(IList<IBean> beans);

        void FromXml(int index, int id, XmlElement xmlBean, IDictionary<string, string> replace);

        XmlNode ToXml(XmlDocument xmlDoc);

        void Parse(string value);

        string ToString();
    }
}
